<?php
class page
{
	public	$pageName;				// This is the name of this page
	public	$topTitleString;		// Top Menu
	public 	$leftMenuString;		// Menu at the left hand side
	public	$pageStringStart;	// This is where the menu option selected will open
	public	$pageStringEnd;
	public	$contentStringStart;
	public	$contentStringEnd;		// This is where the menu option selected will open
	public	$clearString;
	public	$footer;				// Bottom of the page
	public	$baseAddress;
	

	function __construct($pageName) 
	{
		//$this->baseAddress = "http://ttvuk03703.tandbergtv.lan";
		$this->baseAddress = "";
		$this->pageName = $pageName;
		
		$this->topTitleString = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">
<html xmlns=\"http://www.w3.org/1999/xhtml\">
<head>
<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />
<title>".$pageName."</title>
<meta name=\"keywords\" content=\"\" />
<meta name=\"description\" content=\"\" />
<link href=\"/CSS/style.css\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\" />
</head>
<body>
	<div id=\"logo\">
		<h1>Ericsson Fantasy Football League</h1>
	</div>
	<hr />
	<!-- end #logo -->
	<div id=\"header\">
		<div id=\"menu\">
			<ul>
				<li><a href=\"".$this->baseAddress."/Index.html \" class=\"first\">Home</a></li>
				<li class=\"current_page_item\"><a href=\"".$this->baseAddress."/User/DB_UserLoginMenu.php\">Login</a></li>
				<li><a href=\"".$this->baseAddress."/Admin/DB_AdminMenu.php\">Admin</a></li>
			</ul>
		</div>
		<!-- end #menu -->
	</div>
	<!-- end #header -->
	<!-- end #header-wrapper -->\n";
	
		$this->leftMenuString = "		<div id=\"sidebar\">
			<ul>
				<li>
					<h2>General</h2>
					<ul>
						<li><a href=\"".$this->baseAddress."/Instructions.php\">Instructions</a></li>
						<li><a href=\"".$this->baseAddress."/TeamGenerator.php\">Team name Generator</a></li>
						<li><a href=\"".$this->baseAddress."/DB_UserTeamBuilder.php\">Team Builder</a></li>
						<li><a href=\"".$this->baseAddress."/DB_Physio.php\">Injured Players</a></li>
						<li><a href=\"".$this->baseAddress."/DB_PremiershipFixtures.php\">Premiership Fixtures</a></li>
						<li><a href=\"http://news.bbc.co.uk/sport1/hi/football/fa_cup/fixtures/default.stm\">FA Cup Fixtures</a></li>
					</ul>
				</li>
				<li>
					<h2>Season</h2>
					<ul>
						<li><a href=\"".$this->baseAddress."/DB_ShowTeams.php\">Teams</a></li>
						<li><a href=\"".$this->baseAddress."/DB_ShowScoreboard.php\">Scoreboard</a></li>
						<li><a href=\"".$this->baseAddress."/DB_ShowPlayers.php\">Players' Scores</a></li>
						<li><a href=\"".$this->baseAddress."/DB_TeamOfTheWeek.php\">Team Of The Week</a></li>
						<li><a href=\"".$this->baseAddress."/TeamOfTheMonth/DB_TeamOfTheMonth.php\">Team Of The Month</a></li>
						<li><a href=\"".$this->baseAddress."/EricssonCup\DB_EricssonCup.php\">Ericsson Cup</a></li>
						<li><a href=\"".$this->baseAddress."/DB_Debts.php\">Debt Table</a></li>
						<li><a href=\"".$this->baseAddress."/DB_TransferActivity.php\">Transfer Activity</a></li>
						<li><a href=\"".$this->baseAddress."/DB_CaptainActivity.php\">Captains Activity</a></li>
					</ul>
				</li>
			</ul>
		</div>
		<!-- end #sidebar -->\n";

		$this->pageStringStart = "	<div id=\"page\">\n";
		
		$this->pageStringEnd = "	</div><!-- end #page -->\n\n";
		
		$this->contentStringStart = "		<div id=\"content\">\n";
		
		$this->contentStringEnd = "		</div><!-- end #content -->\n\n";
		
		$this->clearString = "		<div style=\"clear: both;\">&nbsp;</div>\n";
		
		$cDates = new dates;
		$currentWeek = $cDates->getCurrentWeek();
		if ($currentWeek < 1)
		{
			$startDate = $cDates->getStartDateFromWeek($currentWeek);
			$endDate = $cDates->getEndDateFromWeek($currentWeek);
		}
		else
		{
			$startDate = $cDates->getStartDateFromWeek($currentWeek);
			$endDate = $cDates->getEndDateFromWeek($currentWeek);
		}
		
		//echo date('l jS \of F Y h:i:s A');
		
		$this->footer = "	<div id=\"footer\">
		<p>Ericsson Fantasy Football League 2010-2011.</p>
		<p>Week ".$currentWeek." - ".date('l jS \of F Y',$startDate)." - ".date('l jS \of F Y',$endDate)."</p>
	</div>
	<!-- end #footer -->
	</body>
</html>\n";
	}
	
	function getTitle()
	{
		return $this->topTitleString;
	}
	
	function getMenu()
	{
		return $this->leftMenuString;
	}

	function pageStringStart()
	{
		return $this->pageStringStart;
	}
	
	function pageStringEnd()
	{
		return $this->pageStringEnd;
	}
	
	function contentStringStart()
	{
		return $this->contentStringStart;
	}
	
	function getContentStringEnd()
	{
		return $this->contentStringEnd;
	}
	
	function getClear()
	{
		return $this->clearString;
	}
	
	function getFooter()
	{
		return $this->footer;
	}
	
	function __destruct() 
	{
      
	}
}
?>